package com.lagou.demo2.servlet;

import com.lagou.framework.common.HttpServlet;
import com.lagou.framework.common.Request;
import com.lagou.framework.common.Response;
import com.lagou.framework.util.HttpProtorcolUtil;

import java.io.IOException;

/**
 * @author srh
 * @date 2020/04/03
 **/
public class DemoServlet2 extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) throws IOException {
        String data = String.format("webContext:[%s], servlet:[%s], requestMethod:[%s]", "demo2", "DemoServlet2", "doGet");
        String headerStr = HttpProtorcolUtil.getHttpHeader200(data.getBytes().length) + data;
        response.output(headerStr);
    }

    @Override
    public void doPost(Request request, Response response) {

    }
}
